package com.supermap.business.cloud.disaster;

import com.alibaba.dubbo.config.annotation.Reference;
import com.supermap.dataservice.util.JSONUtil;
import com.supermap.dubbo.api.cloud.disastercloud.DisasterCloudService;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.*;

/**
 * @author aqua
 * @description 灾情
 * @date 2018年11月17 16:31
 * @email 1301584033@qq.com
 */
@Controller
@RequestMapping("/cloud/disaster")
public class DisasterCloudController {


    @Reference(timeout = 1000000)
    private DisasterCloudService disasterCloudService;

    /**
     * 收藏
     * */
    @PutMapping("/inertDiststerCollerct")
    @ResponseBody
    public JSONUtil inertDiststerCollerct(String userId, String disasterId){
        return  disasterCloudService.inertDiststerCollerct(userId,disasterId);
    }

    /**
     * 取消收藏
     * */
    @DeleteMapping("/delDiststerCollerct")
    @ResponseBody
    public JSONUtil delDiststerCollerct(String userId,String disasterId){
        return  disasterCloudService.delDiststerCollerct(userId,disasterId);
    }


    /**
     * 获取灾情所有的列表
     * */
    @GetMapping("/getPageDisasterList")
    @ResponseBody
    public JSONUtil getPageDisasterList(String areaCode, String userId, String farmId, Integer pageNum, Integer pageSise, Integer type,Integer lev,String beginTime,String endTime){
        return disasterCloudService.getPageDisasterList(areaCode,userId,farmId,pageNum,pageSise,type,lev,beginTime,endTime);
    }
    /**
     * 获取更多评论
     */
    @GetMapping("/getPageDisasterContent")
    @ResponseBody
    public JSONUtil getPageDisasterContent(String disasterId,Integer pageNum, Integer pageSise){
        return disasterCloudService.getPageDisasterContent(disasterId,pageNum,pageSise);
    }


}
